// import 'package:flutter_test/flutter_test.dart';
// import 'package:battery_optimizations/battery_optimizations.dart';
// import 'package:battery_optimizations/battery_optimizations_platform_interface.dart';
// import 'package:battery_optimizations/battery_optimizations_method_channel.dart';
// import 'package:plugin_platform_interface/plugin_platform_interface.dart';
//
// class MockBatteryOptimizationsPlatform
//     with MockPlatformInterfaceMixin
//     implements BatteryOptimizationsPlatform {
//
//   @override
//   Future<String?> getPlatformVersion() => Future.value('42');
// }
//
// void main() {
//   final BatteryOptimizationsPlatform initialPlatform = BatteryOptimizationsPlatform.instance;
//
//   test('$MethodChannelBatteryOptimizations is the default instance', () {
//     expect(initialPlatform, isInstanceOf<MethodChannelBatteryOptimizations>());
//   });
//
//   test('getPlatformVersion', () async {
//     BatteryOptimizations batteryOptimizationsPlugin = BatteryOptimizations();
//     MockBatteryOptimizationsPlatform fakePlatform = MockBatteryOptimizationsPlatform();
//     BatteryOptimizationsPlatform.instance = fakePlatform;
//
//     expect(await batteryOptimizationsPlugin.getPlatformVersion(), '42');
//   });
// }


import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
//import 'package:disable_battery_optimization/disable_battery_optimization.dart';

void main() {
  const MethodChannel channel = MethodChannel('disable_battery_optimization');

  TestWidgetsFlutterBinding.ensureInitialized();

  setUp(() {
    channel.setMockMethodCallHandler((MethodCall methodCall) async {
      return '42';
    });
  });

  tearDown(() {
    channel.setMockMethodCallHandler(null);
  });

}
